<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <!--<meta name="referrer" content="no-referrer">-->
    <title>口袋头条</title>
    <style>
	    *{margin:0;padding:0;box-sizing: border-box;}
	    .nonet{width:60%;position: absolute;top:50%;left:50%;margin-top: -30%;margin-left: -30%;}
	    .nonet img{width:100%;}
	    .nonet p{text-align: center;font-size:12px;color:#999;line-height: 36px;}    	
    </style>
    <script type="text/javascript">
	    var ajaxUrl = 'http://api.55duanzi.com/tt/get_domain';
	    var jsdomain='http://kyhdcms.oss-cn-beijing.aliyuncs.com';    	
    	//获取domain回调
    	function ajaxCallback(){
    		var script = document.createElement("script");
	    	script.src = jsdomain+"/newsapp/js/appinit.js?domain@#@"+jsdomain;
	    	script.id='init';
	    	document.body.appendChild(script);
	    }    	
    	//判断网络状态、获取domain
    	function plusReady(){
    		var nt = plus.networkinfo.getCurrentType();
    		if(nt!=1){
			    var ajax = new XMLHttpRequest();
			    ajax.open('get',ajaxUrl);
			    ajax.send();
			    ajax.onreadystatechange = function () {
			      if (ajax.readyState==4 &&ajax.status==200) {
		　　　　     console.log(ajax.responseText);//输入相应的内容
		          jsdomain=ajax.responseText;
		    			ajaxCallback();
		　　         }else if(ajax.readyState==4&&ajax.status!=200){
							ajaxCallback();
						}
					}
    		}else{
    			plus.navigator.closeSplashscreen();
    		}
    	}
    	//初始化
		  if(window.plus){
		    plusReady();
		  }else{
		    document.addEventListener('plusready', plusReady, false);
		  }
    </script>
  </head>
  <body>
	  <div class="nonet" onclick="location.replace(location.href);">
	    <img src="img/nonet.png" />
	    <p>网络出错了，稍后再试吧</p>
	  </div>  	
  </body>
</html>
